package com.almond.admin.controller;

import com.almond.mq.handle.AmqMessageHandle;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 延迟队列测试
 * Created by LPB on 2020/04/20.
 */
@RestController
public class RabbitmqQueueController {

    @Resource
    private AmqMessageHandle amqMessageHandle;

    @PostMapping("/orderMsg")
    public void orderMsg(Long notifyId,Integer delays) {
        amqMessageHandle.orderMsg(notifyId,delays);
    }



    @PostMapping("/sendTopicMsg")
    public void sendTopicMsg(String message) {
        String routingKey = "test";
        amqMessageHandle.sendMsg(message,routingKey);
    }

    @PostMapping("/sendDirectMsg")
    public void sendDirectMsg(String message,String routeKey) {
        amqMessageHandle.sendDirectMsg(message,routeKey);
    }
}
